<?php
require_once(dirname(__FILE__).'/../include/config.inc.php');


$from="34.81495,113.632614";
$to="34.8361,113.5344";
$url="https://apis.map.qq.com/ws/distance/v1/?mode=driving&from=".$from."&to=".$to."&key=IYNBZ-YNYWG-IE6QE-IQPNJ-J3HKV-BVBTX";
var_dump($url);
    $curl = curl_init();

    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_TIMEOUT, 500);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2 );
	//curl_setopt($curl,CURLOPT_CAINFO,dirname(__FILE__).'/cacert.pem');//这是根据http://curl.haxx.se/ca/cacert.pem 下载的证书，添加这句话之后就运行正常了
    curl_setopt($curl, CURLOPT_URL, $url);
    $res = curl_exec($curl);

var_dump($res);

?>
